package com.itheima.practice;

import java.util.Scanner;

public class _05评委打分 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] scours=new int[6];
        for (int i = 0; i < 6; i++) {
            System.out.println("请输入第"+(i+1)+"个评委的分数（0~100之间的整数）");
            scours[i]=sc.nextInt();
        }
        for (int i = 0; i < 6; i++){
            System.out.println(scours[i]);
            System.out.println("==========================");
        }
        for (int i = 0; i < scours.length; i++) {
            for (int j = 0; j < scours.length-1-i; j++) {
                if(scours[j]>scours[j+1]){
                    int temp=scours[j+1];
                    scours[j+1]=scours[j];
                    scours[j]=temp;
                }
            }
        }
        for (int i = 0; i < 6; i++){
            System.out.println(scours[i]);
            System.out.println("-------------------------");
        }
        scours[0]=0;
        scours[scours.length-1]=0;
        int sum=0;
        for (int i = 0; i < scours.length; i++) {
            sum=sum+scours[i];
        }
        System.out.println(sum);
        System.out.println("``````````````````````");
        System.out.println(sum/4);
    }
}
